//package com.wsllx.controller;
//
//import com.wsllx.util.StrUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.*;
//
///**
// * @author liulx
// * @date 2022-08-30
// * @description 模拟其他系统回复
// */
//@Slf4j
//@RestController
//@RequestMapping(value = "/return")
//public class ReturnTestController {
//
//    /**
//     * 模拟省下游系统ispp回省ACK
//     * 然后再回省确认
//     *
//     * @param inXml
//     * @return
//     */
//    @PostMapping("/ispp")
//    public String isppToLsms(@RequestBody String inXml) throws Exception {
////            //生效
////           inXml="<SOAP-ENV:Envelope\n" +
////                   "    xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
////                   "    xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n" +
////                   "    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
////                   "    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
////                   "    xmlns:ns1=\"http://www.npac.gov.cn/NumberPortable/npMessage\">\n" +
////                   "    <SOAP-ENV:Body>\n" +
////                   "        <ns1:ActBroadcastInd>\n" +
////                   "            <MessageID>0018740008888825</MessageID>\n" +
////                   "            <CommandCode>ACT_BROADCAST_IND</CommandCode>\n" +
////                   "            <ServiceType>MOBILE</ServiceType>\n" +
////                   "            <BrcID>8741220831638222</BrcID>\n" +
////                   "            <NpCode>15012213804</NpCode>\n" +
////                   "            <PortOutNetID>00248740</PortOutNetID>\n" +
////                   "            <PortInNetID>00108740</PortInNetID>\n" +
////                   "            <HomeNetID>00248740</HomeNetID>\n" +
////                   "            <TimeStamp>2022-08-31 10:00:00</TimeStamp>\n" +
////                   "            <Remark></Remark>\n" +
////                   "        </ns1:ActBroadcastInd>\n" +
////                   "    </SOAP-ENV:Body>\n" +
////                   "</SOAP-ENV:Envelope>";
////
////        //生效取消
////        inXml="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:ns1=\"http://www.npac.gov.cn/NumberPortable/npMessage\"><SOAP-ENV:Body><ns1:ActBroadcastReverseInd><MessageID>0018790008826228</MessageID><CommandCode>ACT_BROADCAST_REVERSE_IND</CommandCode><ServiceType>MOBILE</ServiceType><BrcID>8791220828601196</BrcID><NpCode>13987971676</NpCode><PortOutNetID>00248790</PortOutNetID><PortInNetID>00108790</PortInNetID><HomeNetID>00248790</HomeNetID><TimeStamp>2022-03-16 11:00:00</TimeStamp><Remark></Remark></ns1:ActBroadcastReverseInd></SOAP-ENV:Body></SOAP-ENV:Envelope>";
////        //注销
////        inXml="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:ns1=\"http://www.npac.gov.cn/NumberPortable/npMessage\"><SOAP-ENV:Body><ns1:DactBroadcastInd><MessageID>0018750008879210</MessageID><CommandCode>DACT_BROADCAST_IND</CommandCode><ServiceType>MOBILE</ServiceType><BrcID>8752220830645370</BrcID><NpCode>19143294583</NpCode><PortOutNetID>00108750</PortOutNetID><PortInNetID>00248750</PortInNetID><HomeNetID>00108750</HomeNetID><Remark></Remark></ns1:DactBroadcastInd></SOAP-ENV:Body></SOAP-ENV:Envelope>";
////        //审计回复
////        inXml="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:ns1=\"http://www.npac.gov.cn/NumberPortable/npMessage\"><SOAP-ENV:Body><ns1:ActBroadcastReverseInd><MessageID>0018790008826228</MessageID><CommandCode>ACT_BROADCAST_REVERSE_IND</CommandCode><ServiceType>MOBILE</ServiceType><BrcID>8791220828601196</BrcID><NpCode>13987971676</NpCode><PortOutNetID>00248790</PortOutNetID><PortInNetID>00108790</PortInNetID><HomeNetID>00248790</HomeNetID><TimeStamp>2022-03-16 11:00:00</TimeStamp><Remark></Remark></ns1:ActBroadcastReverseInd></SOAP-ENV:Body></SOAP-ENV:Envelope>";
//
//        //TODO Ispp回省确认
//        String type = StrUtil.getXmlContent(inXml, "<CommandCode>", "</CommandCode>");
//        String outXml = getOutXml(inXml, type);
//
//        return outXml;
//    }
//
//    private String getOutXml(String inXml, String type) {
//        String outXml = "";
//        String messageID = StrUtil.getXmlContent(inXml, "<MessageID>", "</MessageID>");
//        outXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
//                "<SOAP-ENV:Envelope\n" +
//                "    xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
//                "    xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n" +
//                "    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
//                "    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
//                "    xmlns:ns1=\"http://www.npac.gov.cn/NumberPortable/npMessage\">\n" +
//                "    <SOAP-ENV:Body>\n" +
//                "        <ns1:Ack>\n" +
//                "            <MessageID>" + messageID + "</MessageID>\n" +
//                "            <CommandCode>" + type + "</CommandCode>\n" +
//                "            <ResponseCode>100</ResponseCode>\n" +
//                "            <ErrorMessage/>\n" +
//                "        </ns1:Ack>\n" +
//                "    </SOAP-ENV:Body>\n" +
//                "</SOAP-ENV:Envelope>";
//        log.error("回省ack报文：[{}]", outXml);
//
//        return outXml;
//    }
//
//    /**
//     * 随机6位数
//     *
//     * @return
//     */
//    private String getRandomSixNum() {
//        int intFlag = (int) (Math.random() * 1000000);
//
//        String flag = String.valueOf(intFlag);
//        if (flag.length() == 6 && flag.substring(0, 1).equals("9")) {
//            return String.valueOf(intFlag);
//        } else {
//            intFlag = intFlag + 100000;
//            return String.valueOf(intFlag);
//        }
//    }
//}
